package com.ruoyi.fitment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.fitment.domain.StoreFitment;
import com.ruoyi.fitment.mapper.StoreFitmentMapper;
import com.ruoyi.fitment.service.IStoreFitmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 店铺装修Service业务层处理
 *
 * @author ruoyi
 * @date 2022-08-25
 */
@Service
public class StoreFitmentServiceImpl implements IStoreFitmentService
{
    @Autowired
    private StoreFitmentMapper storeFitmentMapper;

    /**
     * 查询店铺装修
     *
     * @param id 店铺装修主键
     * @return 店铺装修
     */
    @Override
    public StoreFitment selectStoreFitmentById(Long id)
    {
        return storeFitmentMapper.selectStoreFitmentById(id);
    }

    /**
     * 查询店铺装修列表
     *
     * @param storeFitment 店铺装修
     * @return 店铺装修
     */
    @Override
    public List<StoreFitment> selectStoreFitmentList(StoreFitment storeFitment)
    {
        return storeFitmentMapper.selectStoreFitmentList(storeFitment);
    }

    /**
     * 新增店铺装修
     *
     * @param storeFitment 店铺装修
     * @return 结果
     */
    @Override
    public int insertStoreFitment(StoreFitment storeFitment)
    {
        storeFitment.setCreateTime(DateUtils.getNowDate());
        return storeFitmentMapper.insertStoreFitment(storeFitment);
    }

    /**
     * 修改店铺装修
     *
     * @param storeFitment 店铺装修
     * @return 结果
     */
    @Override
    public int updateStoreFitment(StoreFitment storeFitment)
    {
        storeFitment.setUpdateTime(DateUtils.getNowDate());
        return storeFitmentMapper.updateStoreFitment(storeFitment);
    }

    /**
     * 批量删除店铺装修
     *
     * @param ids 需要删除的店铺装修主键
     * @return 结果
     */
    @Override
    public int deleteStoreFitmentByIds(Long[] ids)
    {
        return storeFitmentMapper.deleteStoreFitmentByIds(ids);
    }


    /**
     * 批量逻辑删除店铺装修
     *
     * @param ids 需要删除的店铺装修主键
     * @return 结果
     */
    @Override
    public int logicDeleteStoreFitment(Long[] ids,String delType,Long delUser)
    {
        return storeFitmentMapper.logicDeleteStoreFitment(ids,delType,delUser);
    }

    /**
     * 删除店铺装修信息
     *
     * @param id 店铺装修主键
     * @return 结果
     */
    @Override
    public int deleteStoreFitmentById(Long id)
    {
        return storeFitmentMapper.deleteStoreFitmentById(id);
    }
}
